package com.technology.collection;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map.Entry;
import java.util.Set;

public class MapUsing {

	public static void main(String[] args) {
		 HashMap<Integer, String> employeeMap = new HashMap<Integer, String>();
		 employeeMap.put(1, "Ivanov Ivan Ivanovich");
		 employeeMap.put(2, "Petrov Petr Petrovich");
		 employeeMap.put(3, "Sidorov SIdr Sidorovich");
		 employeeMap.put(4, "Nikolaev Nikolay Nikolaevich");
		 employeeMap.put(28, "Olegov Oleg Olegovich");
		 
//		 Set<Integer> keys = employeeMap.keySet();
//		 for(Iterator<Integer> iter = keys.iterator(); iter.hasNext();){
//			 Integer key = iter.next();
//			 System.out.println(key + "|" + employeeMap.get(key));
//		 }
//		 System.out.println(employeeMap.get(15));
		 
		 for (Entry<Integer, String> keyValuePair : employeeMap.entrySet()){
			 String value = keyValuePair.getValue();
			 Integer key = keyValuePair.getKey();
			 System.out.println(key + "|" + value);
		 }
		 employeeMap.remove(4);
		
	}

}
